#include "my_header.h"
int initTcp(char * ip,char * port)
{
    int sfd=socket(AF_INET,SOCK_STREAM,0);
    int flag=1;
    setsockopt(sfd,SOL_SOCKET,SO_REUSEADDR,&flag,sizeof(flag));
    struct sockaddr_in addr;
    addr.sin_family=AF_INET;
    addr.sin_port=htons(atoi(port));
    addr.sin_addr.s_addr=inet_addr(ip);
    bind(sfd,(struct sockaddr *)&addr,sizeof(addr));
    listen(sfd,50);
    return sfd;
}

